package com.smm.web.vmc.service;

import com.smm.web.vmc.domain.Pager;
import com.smm.web.vmc.domain.Warehouse;
import com.smm.web.vmc.domain.WarehouseImage;
import com.smm.web.vmc.dto.WarehouseDto;

import java.util.List;

/**
 * Created by zhenghao on 2016/9/5.
 * 仓库操作类
 */
public interface WarehouseService {


    List<Warehouse> getAll();

    /**
     * 获取所有仓库信息，并组装成页面需要的 dto 对象
     * @return
     */
    List<WarehouseDto> getAllForDto();


    void add(Warehouse warehouse) throws Exception;


    void add(Warehouse warehouse,String imageList) throws Exception;

    void update(Warehouse warehouse) throws Exception;

    void update(Warehouse warehouse,String imageList) throws Exception;

    Warehouse getOneById(int id);

    /**
     * 删除
     * @param id
     * @throws Exception
     */
    void delete(int id) throws Exception;

    List<Warehouse> listForPage(Pager pager);


    //按类别获取仓库列表
    List<Warehouse> listByTypeForPage(int type,Pager pager);

    List<WarehouseImage> getImageListByid(int id);

    /**
     * 按地区名称查询，分页
     * @param pager
     * @param area
     * @return
     */
    List<Warehouse> listByAreaAndPage(Pager pager, String area);

    List<WarehouseDto> getAllForDtoWithPage(Pager pager);

    /**
     * 按仓库名称搜索，待分页
     * @param pager
     * @param name
     * @return
     */
    List<WarehouseDto> searchByNameForDtoWithPage(Pager pager, String name);

    /**
     * 按仓库名称搜索
     * @param name
     * @return
     */
    List<Warehouse> searchByName(String name);



    //按仓库地区 类别查询仓库列表
    List<Warehouse> listByAreaAndTypeAndPage(Pager pager, String area, int type);
}
